import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  server: {
    host: "0.0.0.0",
    port: 5173,
    proxy: {
        // 将请求 /api/* 转发到 http://localhost:1080
        '/api': {
            target: 'http://localhost:8086',
            changeOrigin: true,
            rewrite: path => path.replace(/^\/api/, '')
        }
    }
  },

  plugins: [vue()],
})
